package com.my.kq.service;

import com.my.kq.dao.LeaveDao;
import com.my.kq.entity.Leave;

import java.util.List;

public class LeaveService {
    public LeaveDao leaveDao=new LeaveDao();
    public List<Leave> getPage(int pageNo,String status) throws Exception {
        List<Leave> page = leaveDao.getPage(pageNo,status);
        return page;
    }

    public int getTotal(String status) throws Exception {
        int total = leaveDao.getTotal(status);
        return total;
    }
    public List<Leave> getPageAll(int pageNo) throws Exception {
        List<Leave> list = leaveDao.getPageAll(pageNo);
        return list;
    }

    public int getTotaoAll() throws Exception {
        int count = leaveDao.getTotalALL();
        return count;
    }

    public void setAgree(int id) throws Exception {
        leaveDao.setAgree(id);
    }

    public Leave getLeaveById(int id) throws Exception {
        Leave leave = leaveDao.getLeaveById(id);
        return leave;
    }
}
